﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace GMAC.ReportingSystem.Business.Components
{
   public class LaoRetailComponent
    {
       // private string sqlQuery;
       // private string fileName;
       // private DataAccess.LaoRetailDataAccess dacLao = null;
       // public LaoRetailComponent() 
       // {
       //     fileName = System.Configuration.ConfigurationManager.AppSettings["querysLaoXml"]; 
       // }
       // public DataTable ExecuteLaoRetail(string sqlQuery)
       // {
       //     dacLao = new DataAccess.LaoRetailDataAccess();
       //     return dacLao.ExecuteLaoRetail(sqlQuery);
       // }
       // public DataTable ExecuteLaoRetail(string sqlQuery,string strConnection)
       // {
       //     dacLao = new DataAccess.LaoRetailDataAccess(strConnection);
       //     return dacLao.ExecuteLaoRetail(sqlQuery);
       // }
       // public object ExecuteOperation(string sqlQuery)
       // {
       //     dacLao = new DataAccess.LaoRetailDataAccess();
       //     return dacLao.ExecuteOperation(sqlQuery);
       // }
       // public object ExecuteOperation(string sqlQuery, string strConnection)
       // {
       //     dacLao = new DataAccess.LaoRetailDataAccess(strConnection);
       //     return dacLao.ExecuteOperation(sqlQuery);
       // }
       // public int ExecuteNonQuery(string sqlQuery, string strConnection)
       // {
       //     dacLao = new DataAccess.LaoRetailDataAccess(strConnection);
       //     return dacLao.ExecuteNonQuery(sqlQuery);
       // }
       // public DataTable FindAccounNumber(string AccountNumber)
       // {
       //     sqlQuery = string.Format(DataAccess.LaoRetailDataAccess.ReadValueNode(fileName,"FindAccounNumber"), AccountNumber);
       //     return ExecuteLaoRetail(sqlQuery);
       // }
        
       // public DataTable FindLateCharge(string AccountNumber)
       // {
       //     sqlQuery = string.Format(DataAccess.LaoRetailDataAccess.ReadValueNode(fileName, "FindLateCharge"), AccountNumber);
       //     return ExecuteLaoRetail(sqlQuery);
       // }
       // public DataTable FindDetailsLateCharge(string AccountNumber)
       // {
       //     //Intcuotas
       //     sqlQuery = string.Format(DataAccess.LaoRetailDataAccess.ReadValueNode(fileName, "FindDetailsLateCharge"), AccountNumber);
       //     return ExecuteLaoRetail(sqlQuery);
       // }
       // public DataTable LastSharesForAccounNumber(string AccountNumber)
       // {
       //     //LastSharesForAccounNumber
       //     sqlQuery = string.Format(DataAccess.LaoRetailDataAccess.ReadValueNode(fileName, "LastSharesForAccounNumber"), AccountNumber);
       //     return ExecuteLaoRetail(sqlQuery);
       // }
        
       // public DataTable FindTotalPayment(string date, string AccountId)
       // {
       //     sqlQuery = string.Format(DataAccess.LaoRetailDataAccess.ReadValueNode(fileName, "FindTotalPayment"), date, AccountId);
       //     return ExecuteLaoRetail(sqlQuery);
       // }
       ////In Local_db
       // public int InsertComment(string AccountNumber,string Comment,string strConnection)
       // {
       //     string Hora = DateTime.Now.ToString("yyyyMMddHHmmss");
       //     string SecuenceNumber = AccountNumber.Substring(AccountNumber.Length - 6, 6)+ Hora.Substring(10, 4);
       //     sqlQuery = string.Format(DataAccess.LaoRetailDataAccess.ReadValueNode(fileName, "InsertComment"), SecuenceNumber, AccountNumber, Comment);
       //     return  ExecuteNonQuery(sqlQuery, strConnection);
       // }

       // public string FindCellular(string AccountNumber)
       // {
       //     sqlQuery = string.Format(DataAccess.LaoRetailDataAccess.ReadValueNode(fileName, "FindCellular"), AccountNumber);
       //     DataTable result = ExecuteLaoRetail(sqlQuery);
       //     if (result.Rows.Count>0)
       //     {
       //         return result.Rows[0].ItemArray[0].ToString();
       //     }
       //     else
       //     {
       //         return "";
       //     }
            
       // }

       // public string FindGraceAmtNextDueDate(string AccountNumber)
       // {
       //     sqlQuery = string.Format(DataAccess.LaoRetailDataAccess.ReadValueNode(fileName, "FindGraceAmtNextDueDate"), AccountNumber);
       //     DataTable result = ExecuteLaoRetail(sqlQuery);
       //     if (result.Rows.Count > 0)
       //     {
       //         if (result.Rows[0].ItemArray[0].ToString()=="")
       //             return "";
       //         else
       //             return result.Rows[0].ItemArray[0].ToString();
       //     }
       //     else
       //     {
       //         return "";
       //     }

       // }
       
    }
    
}
